home *** CD-ROM | disk | FTP | other *** search
- Path: news.ov.com!news
- From: glenn@ov.com (Fletcher.Glenn@ov.com)
- Newsgroups: comp.lang.c
- Subject: Re: Student -- need help with code changes at
- Date: 21 Feb 1996 17:17:21 GMT
- Organization: OpenVision
- Message-ID: <4gfk31$ni7@spanky.pls.ov.com>
- References: <ragnaroek1996Feb19.120437.2325@news2.compulink.com>
- Reply-To: glenn@ov.com
- NNTP-Posting-Host: foghorn.pls.ov.com
-
- In article 2325@news2.compulink.com, epoulin@idirect.com (Eric Poulin) writes:
- >I'm sure this is a no-brainer that i just can't think of. If someone does
- >know,
- >please email me at epoulin@idirect.com.
- >
- >Thanks,
- >
- >Eric
- >
- >
- >The program is for teachers to enter in grades under various categories (ie.
- >quizes, exams)
- >I have defined the following structure
- >
- >typedef struct class_num {
- > int numberOfQuizes;
- > int numberofExams;
- > int quiz1OutOf;
- > int Quiz2OutOf;
- >
- > etc...
- >} CLASS_NUM;
- >
- >The problem is that I want the user (teacher) to be able to change the number
- >of quizes given
- >and even add new categories (ie Attendance). How can I do this without
- >including that information in the struct?
- >I have a couple of ideas but none of them will work.
- >Any help is GREATLY appreciated.
- >
- >
-
- It is fairly easy to make record images that are highly expandable using
- dynamic allocation to store the individual numbers. However, when you
- start to talk about varying the categories (at run time) in a record,
- you are into the domain of "database management" which is the foundation
- of an entire branch of the software industry. Such companies as Informix,
- Sybase, and Oracle have expended 100,000 or more lines of code doing just the
- sort of thing you describe. Of course, these giants are solving the more
- general problem of infinitely variable record structures.
-
- Fletcher.Glenn@ov.com
-
-